

#pragma once
#ifdef ENGINESYSTEM_EXPORTS
#define ENGINESYSTEM_API __declspec(dllexport)
#else
#define ENGINESYSTEM_API __declspec(dllimport)
#endif

#include "IncludeHeader.h"



#include "Game.h"
#include "WinThread.h"


//LRESULT CALLBACK DefaultMessageProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,bool* pbNoFurtherProcessing, void* pUserContext);

//typedef LRESULT (CALLBACK *MSG_PROC) (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,bool* pbNoFurtherProcessing, void* pUserContext);

//typedef void (CALLBACK * RENDER_PROC)( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime,
//                                  float fElapsedTime, void* pUserContext );


#include "BaseEngine.h"
#include "Graphic.h"

class ENGINESYSTEM_API EngineSystem
{

public :
	EngineSystem(void);
	~EngineSystem();
	HRESULT Initialize(int wnd_w,int wnd_h,WCHAR* appname = L"test");
	void Shutdown();
	HRESULT Run(HACCEL hAccel = NULL); 
public :
	void SetMulitThreadRender(bool flag);
public :
	void Update(double fTime, float fElapsedTime);
	void Render(double fTime, float fElapsedTime);
private :
	LPCWSTR m_ApplicationName;
	HINSTANCE m_Hinstance;
	HWND m_Hwnd;
	BaseEngine * m_pBaseEngine;
	GraphicSystem * m_pGraphicSystem;
	WinThreadControler * m_pWinThreadControler;
	Win32UpdateCell * m_pWin32UpdateCell;
	Win32RenderCell * m_pWin32RenderCell;
	//MSG_PROC m_pOutPassedMsgProc;
protected :
	
	//Game* m_pGameSystem;

	
};



//extern ENGINESYSTEM_API int nCEngine;
//
//ENGINESYSTEM_API int fnCEngine(void);
